<template>
  <div class="wrap">
    <header>
      <div class="headertop">
        <div class="header-img">
          <v-back></v-back>
        </div>
        <h1>
          <v-title></v-title>
        </h1>
        <div class="topradius">
          <i class="iconfont icon-xiaochengxu-gengduo"></i>
          <i class="topborder"></i>
          <i class="iconfont icon-xiaochengxu-guanbi"></i>
        </div>
      </div>
      <div class="nav">
        <div class="search">
          <label for="seach">
            <i class="iconfont icon-fangdajing"></i>
          </label>
          <input type="search" name="" id="seach" placeholder="按内容搜索" />
        </div>
      </div>
    </header>
    <div class="content">
      <div class="content-top">筛选11.11大促商品</div>
      <div class="product-list" v-for="item in searchlist" :key="item.id">
        <div class="porduct-img">
          <img :src="item.img" alt="" />
        </div>
        <div class="product-txt">
          <p>{{ item.goodsname }}</p>
          <p>
            <i>￥</i>{{ item.price }}<b>￥{{ item.market_price }}</b
            ><i>999人已付款</i>
          </p>
          <p>11.11限时299元起</p>
          <p><i>999条评论 </i><i>99.9%好评</i></p>
        </div>
      </div>
    </div>
    <footer>
      <img src="../assets/Image/m-index/foot-bottom.png" alt="" />
    </footer>
  </div>
</template>

<script>
import { search, getgoodlist } from "../request/api";
export default {
  data() {
    return {
      kw: this.$route.params.id,
      searchlist: [],
    };
  },
  mounted() {
    // 搜索
    search({
      keywords: this.kw,
    }).then((res) => {
      // console.log(res, "成功");
      if (res.data.code == 200) {
        this.searchlist = res.data.list;
      }
    });
    getgoodlist({
      cateid: this.$route.params.id,
      type: 1,
    }).then((res) => {
      // console.log(res, "2222");
      if (res.data.code == 200) {
        this.goodslist = res.data.list.goodData;
      }
    });
  },
};
</script>

<style scoped>
.nav {
  height: 1.6rem;
  padding: 0 0.2rem;
  background-image: linear-gradient(180deg, #ff6040 0%, #ff8a80 100%);
  box-shadow: 0 2px 6px 0 rgba(255, 149, 128, 0.5);
}
.search {
  position: relative;
}
.search input {
  width: 100%;
  height: 0.64rem;
  border: 1px solid #e6e6e6;
  border-radius: 3px;
  padding-left: 0.7rem;
  font-size: 0.44rem;
  margin-top: 0.2rem;
}
.search label i {
  font-size: 0.44rem;
}
.search label {
  position: absolute;
  top: 50%;
  margin-top: -0.11rem;
  left: 0.13rem;
}

.icon-caidan {
  vertical-align: middle;
  position: relative;
  top: -0.04rem;
  font-size: 0.32rem;
}

.content {
  padding: 0.2rem;
}
.content-top {
  height: 0.64rem;
  width: 100%;
  background: #fff4f2;
  border: 0 solid #ff6040;
  border-radius: 2px;
  text-align: center;
  line-height: 0.64rem;
  font-size: 0.32rem;
  color: #ff6040;
}
.product-list {
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
}
.porduct-img img {
  width: 2.16rem;
  height: 2.16rem;
}
.product-txt {
  width: 100%;
  margin-left: 0.3rem;
}

.product-txt p:first-child {
  font-size: 0.32rem;
  color: #333333;
  line-height: 0.32rem;
}
.product-txt p:nth-child(2) {
  font-size: 0.28rem;
  color: #999999;
  line-height: 0.28rem;
  margin-top: 0.1rem;
}
.product-txt p:nth-child(3) e {
  font-size: 0.2rem;
  color: #ff6040;
  line-height: 0.16rem;
}
.product-txt p:nth-child(3) {
  font-size: 0.4rem;
  color: #ff6040;
  line-height: 0.32rem;
  margin-top: 0.3rem;
}
.product-txt p:nth-child(3) b {
  font-size: 0.2rem;
  color: #999999;
  line-height: 0.16rem;
  text-decoration: line-through;
  margin-left: 0.1rem;
}
.product-txt p:nth-child(3) i {
  font-size: 0.2rem;
  color: #999999;
  line-height: 0.2rem;
  margin-left: 0.2rem;
}
.product-txt p:nth-child(4) {
  font-size: 0.2rem;
  color: #ffffff;
  width: 1.66rem;
  height: 0.333rem;
  line-height: 0.333rem;
  background: #ff8066;
  margin-top: 0.1rem;
}
.product-txt p:nth-child(5) i {
  font-size: 0.2rem;
  color: #999999;
  line-height: 0.2rem;
  margin-right: 0.3rem;
}
.product-txt p:nth-child(5) {
  margin-top: 0.18rem;
}
footer {
  background-color: transparent;
  height: auto;
}
</style>
